fn make_atm():fn(int):int {
    var cash = 1000
    return fn(int amount):int {
        cash -= amount
        return cash
    }
}

fn makes() {
    [fn(int):int] atms = []

    int i = 0
    for i < 1000 {
        var atm_draw = make_atm()
        atms.push(atm_draw)
        i += 1
    }

    println(runtime_malloc_bytes())
    println(atms[10](10))
    println(atms[599](100))
    println(atms[999](200))

    runtime_gc()
    println(runtime_malloc_bytes())
    println(atms[10](10))
    println(atms[599](100))
    println(atms[999](200))
}

makes()

runtime_gc()
println(runtime_malloc_bytes())
